import Layout from '@/layout'

// import myPermission from '@/utils/my-permission'
// const p = new myPermission()
// const rolesList = p.getUrlRole('/permission')

export default {
  path: '/permission',
  component: Layout,
  redirect: '/permission/role',
  name: 'Permission',
  // 权限管理一定要加上超管
  meta: { title: '权限管理', icon: 'people', noCache: true, roles: ['permission'] },
  children: [
    {
      path: 'menu',
      name: 'PermissionMenu',
      component: () => import('@/views/permission/menu/list'),
      meta: { title: '菜单', icon: 'star', noCache: true }
    },
    {
      path: 'menu-create',
      name: 'PermissionMenuCreate',
      component: () => import('@/views/permission/menu/create'),
      meta: { title: '添加菜单', icon: 'star', noCache: true },
      hidden: true
    },
    {
      path: 'menu-edit/:id',
      name: 'PermissionMenuEdit',
      component: () => import('@/views/permission/menu/edit'),
      meta: { title: '编辑菜单', icon: 'star', noCache: true },
      hidden: true
    },
    {
      path: 'role',
      name: 'PermissionRole',
      component: () => import('@/views/permission/role/list'),
      meta: { title: '角色', icon: 'star', noCache: true }
    },
    {
      path: 'role-create',
      name: 'PermissionRoleCreate',
      component: () => import('@/views/permission/role/create'),
      meta: { title: '添加角色', icon: 'star', noCache: true },
      hidden: true
    },
    {
      path: 'role-edit/:id',
      name: 'PermissionRoleEdit',
      component: () => import('@/views/permission/role/edit'),
      meta: { title: '编辑角色', icon: 'star', noCache: true },
      hidden: true
    },
    {
      path: 'role-menu/:id',
      name: 'PermissionRoleMenu',
      component: () => import('@/views/permission/role/role-menu'),
      meta: { title: '角色权限', icon: 'star', noCache: true },
      hidden: true
    },
    {
      path: 'admin',
      name: 'PermissionAdmin',
      component: () => import('@/views/permission/admin/list'),
      meta: { title: '管理员', icon: 'star', noCache: true }
    },
    {
      path: 'admin-create',
      name: 'PermissionAdminCreate',
      component: () => import('@/views/permission/admin/create'),
      meta: { title: '添加管理员', icon: 'star', noCache: true },
      hidden: true
    },
    {
      path: 'admin-edit/:id',
      name: 'PermissionAdminEdit',
      component: () => import('@/views/permission/admin/edit'),
      meta: { title: '编辑管理员', icon: 'star', noCache: true },
      hidden: true
    },
    {
      path: 'admin-role/:id',
      name: 'PermissionAdminRole',
      component: () => import('@/views/permission/admin/admin-role'),
      meta: { title: '管理员角色', icon: 'star', noCache: true },
      hidden: true
    }
  ]
}
